package com.sunnyebuy.merchant.po;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * The persistent class for the customer_order database table.
 * 
 */
@Entity
@Table(name = "customer_order")
public class CustomerOrder implements Serializable {

	private static final long serialVersionUID = 8568646726271219921L;
	private String customerOrderId;
	private Timestamp createdTime;
	private String customerId;
	private Date customerOrderConfirmed;
	private BigDecimal customerOrderDiscountTotal;
	private BigDecimal customerOrderGrandTotal;
	private Date customerOrderLastChanged;
	private BigDecimal customerOrderReceivedTotal;
	private BigDecimal customerOrderTotal;
	private String customerOrderTx;
	private int customerOrderType;
	private BigDecimal handlingTotal;
	private String invoiceNo;
	private String merchantId;
	private String merchantImportBatch;
	private int orderStatus;
	private String payVoucherNo;
	private int paymentStatus;
	private BigDecimal productTotal;
	private BigDecimal refundedTotal;
	private int shippingInsuranceEnabled;
	private BigDecimal shippingInsuranceTotal;
	private int shippingPolicy;
	private int shippingPriority;
	private int shippingStatus;
	private BigDecimal shippingTotal;
	private String shippingType;
	private String tradeNo;
	private BigDecimal wrappingTotal;
	private CustomerOrderShippingAddress customerOrderShippingAddress;
	private List<CustomerOrderProductDetail> customerOrderProductDetails;

	public CustomerOrder() {
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "customer_order_id")
	public String getCustomerOrderId() {
		return this.customerOrderId;
	}

	public void setCustomerOrderId(String customerOrderId) {
		this.customerOrderId = customerOrderId;
	}

	@Column(name = "created_time")
	public Timestamp getCreatedTime() {
		return this.createdTime;
	}

	public void setCreatedTime(Timestamp createdTime) {
		this.createdTime = createdTime;
	}

	@Column(name = "customer_id")
	public String getCustomerId() {
		return this.customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "customer_order_confirmed")
	public Date getCustomerOrderConfirmed() {
		return this.customerOrderConfirmed;
	}

	public void setCustomerOrderConfirmed(Date customerOrderConfirmed) {
		this.customerOrderConfirmed = customerOrderConfirmed;
	}

	@Column(name = "customer_order_discount_total")
	public BigDecimal getCustomerOrderDiscountTotal() {
		return this.customerOrderDiscountTotal;
	}

	public void setCustomerOrderDiscountTotal(BigDecimal customerOrderDiscountTotal) {
		this.customerOrderDiscountTotal = customerOrderDiscountTotal;
	}

	@Column(name = "customer_order_grand_total")
	public BigDecimal getCustomerOrderGrandTotal() {
		return this.customerOrderGrandTotal;
	}

	public void setCustomerOrderGrandTotal(BigDecimal customerOrderGrandTotal) {
		this.customerOrderGrandTotal = customerOrderGrandTotal;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "customer_order_last_changed")
	public Date getCustomerOrderLastChanged() {
		return this.customerOrderLastChanged;
	}

	public void setCustomerOrderLastChanged(Date customerOrderLastChanged) {
		this.customerOrderLastChanged = customerOrderLastChanged;
	}

	@Column(name = "customer_order_received_total")
	public BigDecimal getCustomerOrderReceivedTotal() {
		return this.customerOrderReceivedTotal;
	}

	public void setCustomerOrderReceivedTotal(BigDecimal customerOrderReceivedTotal) {
		this.customerOrderReceivedTotal = customerOrderReceivedTotal;
	}

	@Column(name = "customer_order_total")
	public BigDecimal getCustomerOrderTotal() {
		return this.customerOrderTotal;
	}

	public void setCustomerOrderTotal(BigDecimal customerOrderTotal) {
		this.customerOrderTotal = customerOrderTotal;
	}

	@Column(name = "customer_order_tx")
	public String getCustomerOrderTx() {
		return this.customerOrderTx;
	}

	public void setCustomerOrderTx(String customerOrderTx) {
		this.customerOrderTx = customerOrderTx;
	}

	@Column(name = "customer_order_type")
	public int getCustomerOrderType() {
		return this.customerOrderType;
	}

	public void setCustomerOrderType(int customerOrderType) {
		this.customerOrderType = customerOrderType;
	}

	@Column(name = "handling_total")
	public BigDecimal getHandlingTotal() {
		return this.handlingTotal;
	}

	public void setHandlingTotal(BigDecimal handlingTotal) {
		this.handlingTotal = handlingTotal;
	}

	@Column(name = "invoice_no")
	public String getInvoiceNo() {
		return this.invoiceNo;
	}

	public void setInvoiceNo(String invoiceNo) {
		this.invoiceNo = invoiceNo;
	}

	@Column(name = "merchant_id")
	public String getMerchantId() {
		return this.merchantId;
	}

	public void setMerchantId(String merchantId) {
		this.merchantId = merchantId;
	}

	@Column(name = "merchant_import_batch")
	public String getMerchantImportBatch() {
		return this.merchantImportBatch;
	}

	public void setMerchantImportBatch(String merchantImportBatch) {
		this.merchantImportBatch = merchantImportBatch;
	}

	@Column(name = "order_status")
	public int getOrderStatus() {
		return this.orderStatus;
	}

	public void setOrderStatus(int orderStatus) {
		this.orderStatus = orderStatus;
	}

	@Column(name = "pay_voucher_no")
	public String getPayVoucherNo() {
		return this.payVoucherNo;
	}

	public void setPayVoucherNo(String payVoucherNo) {
		this.payVoucherNo = payVoucherNo;
	}

	@Column(name = "payment_status")
	public int getPaymentStatus() {
		return this.paymentStatus;
	}

	public void setPaymentStatus(int paymentStatus) {
		this.paymentStatus = paymentStatus;
	}

	@Column(name = "product_total")
	public BigDecimal getProductTotal() {
		return this.productTotal;
	}

	public void setProductTotal(BigDecimal productTotal) {
		this.productTotal = productTotal;
	}

	@Column(name = "refunded_total")
	public BigDecimal getRefundedTotal() {
		return this.refundedTotal;
	}

	public void setRefundedTotal(BigDecimal refundedTotal) {
		this.refundedTotal = refundedTotal;
	}

	@Column(name = "shipping_insurance_enabled")
	public int getShippingInsuranceEnabled() {
		return this.shippingInsuranceEnabled;
	}

	public void setShippingInsuranceEnabled(int shippingInsuranceEnabled) {
		this.shippingInsuranceEnabled = shippingInsuranceEnabled;
	}

	@Column(name = "shipping_insurance_total")
	public BigDecimal getShippingInsuranceTotal() {
		return this.shippingInsuranceTotal;
	}

	public void setShippingInsuranceTotal(BigDecimal shippingInsuranceTotal) {
		this.shippingInsuranceTotal = shippingInsuranceTotal;
	}

	@Column(name = "shipping_policy")
	public int getShippingPolicy() {
		return this.shippingPolicy;
	}

	public void setShippingPolicy(int shippingPolicy) {
		this.shippingPolicy = shippingPolicy;
	}

	@Column(name = "shipping_priority")
	public int getShippingPriority() {
		return this.shippingPriority;
	}

	public void setShippingPriority(int shippingPriority) {
		this.shippingPriority = shippingPriority;
	}

	@Column(name = "shipping_status")
	public int getShippingStatus() {
		return this.shippingStatus;
	}

	public void setShippingStatus(int shippingStatus) {
		this.shippingStatus = shippingStatus;
	}

	@Column(name = "shipping_total")
	public BigDecimal getShippingTotal() {
		return this.shippingTotal;
	}

	public void setShippingTotal(BigDecimal shippingTotal) {
		this.shippingTotal = shippingTotal;
	}

	@Column(name = "shipping_type")
	public String getShippingType() {
		return this.shippingType;
	}

	public void setShippingType(String shippingType) {
		this.shippingType = shippingType;
	}

	@Column(name = "trade_no")
	public String getTradeNo() {
		return this.tradeNo;
	}

	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
	}

	@Column(name = "wrapping_total")
	public BigDecimal getWrappingTotal() {
		return this.wrappingTotal;
	}

	public void setWrappingTotal(BigDecimal wrappingTotal) {
		this.wrappingTotal = wrappingTotal;
	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
	@JoinColumn(name = "customer_order_shipping_address")
	public CustomerOrderShippingAddress getCustomerOrderShippingAddress() {
		return this.customerOrderShippingAddress;
	}

	public void setCustomerOrderShippingAddress(CustomerOrderShippingAddress customerOrderShippingAddress) {
		this.customerOrderShippingAddress = customerOrderShippingAddress;
	}

	@OneToMany(mappedBy = "customerOrder", cascade = { CascadeType.ALL })
	public List<CustomerOrderProductDetail> getCustomerOrderProductDetails() {
		return this.customerOrderProductDetails;
	}

	public void setCustomerOrderProductDetails(List<CustomerOrderProductDetail> customerOrderProductDetails) {
		this.customerOrderProductDetails = customerOrderProductDetails;
	}

}